package com.atguigu.behavior.memento;

public class GameClient {
    public static void main(String[] args) {
        Memento memento = new Memento(100, "正常", "文柚果");
        Originator originator = new Originator(memento);

        // ready
        originator.save();
        memento.setHp(30);
        memento.setState("烧伤");
        memento.setItem(null);

        System.out.println("battle:"+memento);


        // after
        originator.load();
        System.out.println("recover:"+memento);
    }
}
